import { TabsPage } from './../tabs/tabs';
import { Component, ViewChild } from '@angular/core';
import { NavController, Slides } from 'ionic-angular';
import { ViewController } from 'ionic-angular/navigation/view-controller';
import { Storage } from '@ionic/storage/dist/storage';
import { LoginPage } from '../login/login';
import { App } from 'ionic-angular/components/app/app';
import { STORE_HAS_GUIDE_KEY } from '../../config/constants';
import { Api } from '../../providers/api-service';

@Component({
	selector: 'page-welcome',
	templateUrl: 'welcome.html'
})
export class WelcomePage {
	@ViewChild(Slides) slides: Slides;
	constructor(
		public app: App,
		public navCtr: NavController,
		public viewCtrl: ViewController,
		public api: Api,
		public storage: Storage
	) { }

	/**
	 * 立刻体验按钮
	 */
	slideHasChanged() {
		
		this.storage.get('firstIn').then((result) => {
			debugger
			if (result == 2) {
				this.app.getRootNav().push(TabsPage);
			} else {
				this.app.getRootNav().push(LoginPage);
			}
		});
	}
}
